package  
{
	import org.flixel.*;
	/**
	 * ...
	 * @author Lucas
	 */
	public class PlayState extends FlxState
	{
		
		// Walls
		private var leftWall:FlxTileblock;
		private var floor:FlxTileblock;
		private var rightWall:FlxTileblock;
		
		// Player
		private var player:Player;
		[Embed(source = "../sprites/player/coolguy.png")] 
		private var playerSprite:Class;
		
		override public function create():void 
		{
		
		// Zoom Camera
		FlxG.camera.zoom = 3;
		
		// Initialize Screen
		FlxG.bgColor = 0xFF4FC6FF;
		FlxG.framerate = 60;
		FlxG.flashFramerate = 60;
		
		// Walls
		leftWall = new FlxTileblock(0, 0, 100, FlxG.height);
		leftWall.makeGraphic(10, FlxG.height, 0xFFFF1515);
		add(leftWall);	
		
		rightWall = new FlxTileblock(FlxG.width - 10, 0, 100, FlxG.height);
		rightWall.makeGraphic(10, FlxG.height, 0xFFFF1515);
		add(rightWall);	
		
		floor = new FlxTileblock(0, FlxG.height - 10, 100, FlxG.height);
		floor.immovable;
		floor.makeGraphic(FlxG.width, 10, 0xFFFF1515);
		add(floor);	
		
		// Player
		player = new Player();
		player.loadGraphic(playerSprite);
		add(player);
		
		
		FlxG.camera.target = player;
		}
		
		override public function update():void {
			
						
			super.update();
			
				
			FlxG.collide(floor, player);
			FlxG.collide(leftWall, player);
			FlxG.collide(rightWall, player);
			
		}
	}

}